<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{$config_sitename}</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="__CSS__/swiper-3.2.7.min.css?t={$ver}" rel="stylesheet" type="text/css">
<link href="__CSS__/custom.css?t={$ver}" rel="stylesheet">
</head>
<body class="body-pad cl-b-lgrey">
	<div class="ub ub-ac page-header row">
		<div class="index-pop">
			<img src="__IMAGES__/icon-cam2.png">
			<ul class="pop-nav">
				<li><a href="{:U('Work/add')}" class="cl-f-xlgrey">发食谱</a></li>
				<li><a href="{:U('Suipai/add')}" class="cl-f-xlgrey">随手拍</a></li>
			</ul>
		</div>
		<div class="ub-f1"><input type="text" class="f14 search-innput" name="select" placeholder="搜索食谱"></div>
		<a href="/weixin/user/sysList" class="icon-msg">
    	<if condition="$sysnum neq 0">
    		<!-- 有消息 -->
    		<img src="__IMAGES__/icon-msg2.png" width="28px">
    	<else/>
    		<!-- 无消息 -->
    		<img src="__IMAGES__/icon-msg.png">
    	</if>
    	</a>
		<a href="javascript:;" class="clickable cl-f-lorange search-submit" style="display: none;">
			搜索
		</a> 
	</div>
	<div class="search hide">
	   <div class="hot-search cl-b-white row">
            <p class="cl-f-xlgrey">热门搜索</p>
            <foreach name="list" item="lt">
            <div class="type-item-info ub ub-ac ub-bc ub-pj">
                <foreach name="lt" item="ll">
                <span class="search-text clickable text-overflow search-js">{$ll.title}</span>
                </foreach>
            </div>
            </foreach>
        </div>
        
     </div>
     
    <div class="cover hide">
            
    </div>
             
    <div class="index-swiper swiper-container">
		<div class="swiper-wrapper">
		<foreach name="indexmidad" item="im">
	        <div class="swiper-slide href-js" data-url="{$im.linkurl}"><img src="{$im.image}"></div>
        </foreach>
	    </div> 
	    <div class="swiper-pagination"></div>
    </div>
    <div class="row ub five-grid index-five-grid f12 cl-b-white cl-f-dgrey">
    	<!--  <div class="ub-f1 ub-ver clickable ub-pc ub-con href-js" data-url="{:U('Index/category')}"><img src="__IMAGES__/index_b1.png"><p>食谱分类</p></div>
    	<div class="ub-f1 ub-ver clickable ub-pc ub-con href-js" data-url="{:U('Suipai/index')}"><img src="__IMAGES__/index_b2.png"><p>随手拍</p></div>
    	<div class="ub-f1 ub-ver clickable ub-pc ub-con"><img src="__IMAGES__/index_b3.png"><p>烘焙宝典</p></div>
    	<div class="ub-f1 ub-ver clickable ub-pc ub-con sign-js" data-sign="{$mysign}"><img src="__IMAGES__/index_b4.png"><p>签到有奖</p></div>
    	<div class="ub-f1 ub-ver clickable ub-pc ub-con"><img src="__IMAGES__/index_b5.png"><p>有奖征集</p></div>-->
    	<foreach name="nav" item="nn">
    	       <div class="ub-f1 ub-ver clickable ub-pc ub-con href-js" data-url="{$nn.linkUrl}"><img src="{$nn.image}"><p>{$nn.title}</p></div>
    	</foreach>
    </div>
    <div class="row index-section cl-b-white">
    	<h3 class="index-section-name cl-f-orange f16">精选食谱<span class="index-section-more f14"><a href="{:U('Work/dynamic')}" class="cl-f-lgrey">更多&gt;</a></span></h3>
    	<div class="ub">
    	<foreach name="work" item="wk">
    		<div class="ub-f1 index-block clickable href-js" data-url="{:U('Work/detail')}?workid={$wk.workid}">
    			<div class="lazy" data-original="{$wk.image}"><img src="__IMAGES__/o2.png" class="oimg"></div>
    			<p class="cl-f-grey ub ub-pc"><span class="ub-con text-overflow">{$wk.title}</span></p>
    		</div>
		</foreach>
    	</div>
    </div>
    <div class="row index-section cl-b-white index-suipai">
    	<h3 class="index-section-name cl-f-orange f16">随拍作品<span class="index-section-more f14"><a href="{:U('Suipai/index')}" class="cl-f-lgrey">更多&gt;</a></span></h3>
    	<div class="ub">
    	<foreach name="suipai" item="sp">
    		<div class="ub-f1 index-block clickable href-js" data-url="{:U('Suipai/detail')}?id={$sp.id}">
    			<div class="lazy" data-original="{$sp.image}"><img src="__IMAGES__/o2.png" class="oimg"></div>
    			<p class="cl-f-grey ub ub-pc"><span class="ub-con text-overflow">{$sp.title}</span></p>
    		</div>
		</foreach>
    	</div>
    </div>
    <div class="index-section cl-b-white" style="display: none;">
    	<h3 class="index-section-name cl-f-orange f16 row">烘焙宝典<span class="index-section-more f14"><a href="#" class="cl-f-lgrey">更多&gt;</a></span></h3>
    	<ul class="index-baodian-list">
    		<li class="ub clickable ub-ac row">
    			<div class="lazy" data-original="__IMAGES__/img5.png"><img src="__IMAGES__/o3.png" class="oimg"></div>
    			<div class="ub-f1 cl-f-grey index-baodian-title">[饼干]不可不看 烘焙饼干时困扰你的九个问题，失败的六大真相！</div>
    		</li>
    		<li class="ub clickable ub-ac row">
    			<div class="lazy" data-original="__IMAGES__/img5.png"><img src="__IMAGES__/o3.png" class="oimg"></div>
    			<div class="ub-f1 cl-f-grey index-baodian-title">[饼干]不可不看 烘焙饼干时困扰你的九个问题，失败的六大真相！</div>
    		</li>
    		<li class="ub clickable ub-ac row">
    			<div class="lazy" data-original="__IMAGES__/img5.png"><img src="__IMAGES__/o3.png" class="oimg"></div>
    			<div class="ub-f1 cl-f-grey index-baodian-title">[饼干]不可不看 烘焙饼干时困扰你的九个问题，失败的六大真相！失败的六大真相！失败的六大真相！</div>
    		</li>
    	</ul>
    </div>
    <div class="index-banner-img lazy href-js" data-original="{$indexleftad.image}" data-url="{$indexleftad.linkurl}">
    	<img src="__IMAGES__/o4.png" class="oimg">
    </div>
    <div class="row index-section cl-b-white index-hot">
    	<h3 class="index-section-name cl-f-orange f16">热门活动<span class="index-section-more f14"><a href="#" class="cl-f-lgrey">更多&gt;</a></span></h3>
    	<div class="ub">
    		<div class="ub-f1 index-block clickable ub-con">
    			<div class="lazy href-js" data-original="{$activity.imageone}" data-url="{$activity.urlone}"><img src="__IMAGES__/o2.png" class="oimg" id="test"></div>
    		</div>
    		<div class="ub-f1 index-block ub-ver ub-con index-ver-block">
    			<div class="lazy clickable href-js" data-original="{$activity.imagetwo}" data-url="{$activity.urltwo}"><img src="__IMAGES__/o5.png" class="oimg"></div>
    			<div class="lazy clickable href-js" data-original="{$activity.imagethree}" data-url="{$activity.urlthree}"><img src="__IMAGES__/o5.png" class="oimg"></div>
    		</div>
    	</div>
    </div>
    <div class="row index-section cl-b-white">
        <h3 class="index-section-name cl-f-orange f16">活跃达人<span class="index-section-more f14"><a href="{:U('Index/member')}" class="cl-f-lgrey">更多&gt;</a></span></h3>
        <div class="ub five-grid daren-five-grid f12 cl-f-lgrey">
        <foreach name="sharedaren" item="sd">
        <div class="ub-f1 ub-ver clickable ub-pc ub-con href-js" data-url="{:U('Ucenter/index')}?id={$sd.userid}"><img src="{$sd.uavatar}"><p class="ub ub-pc"><span class="ub-con text-overflow">{$sd.nickname}</span></p></div>
        </foreach>
        </div>
    </div>
    <include file="Public:nav" />
	<script src="__JS__/jquery-1.11.1.min.js?t={$ver}"></script>
	<script src="__JS__/swiper-3.2.7.jquery.min.js?t={$ver}"></script>
	<script src="__JS__/jquery.lazyload.min.js?t={$ver}"></script>
    <script src="__JS__/custom.js?t={$ver}"></script>
    <script src="__JS__/common.js?t={$ver}"></script>
    <script type="text/javascript">
    var img_url = "__IMAGES__";
    	 var mySwiper = new Swiper ('.swiper-container', {
    	 	autoplay: 3000,
    		loop: true,
		    pagination: '.swiper-pagination'
  		});        

  		$(function(){
  		    $('.body-pad').on('click', '.href-js', function(e){
    		    e.preventDefault();
    		    var url = $(this).attr('data-url');
                if(url == undefined || url == '')
                {
                    return false;
                }
                location.href = url;
  		    });

  		    var $search = $(".cover");
  		    


    		$('.search-innput').focus(function(e){
    			e.preventDefault();
  	  		    $search.removeClass("hide");
  	            $('.icon-msg').hide();
  	            $('.search-submit').show();
  	            $('input[name=select]').attr('placeholder', '');
  	        });

  	        
    	    $('.body-pad').on('click', '.cover', function(e){
	  		    e.preventDefault();
  	  		    $search.addClass("hide");
      	  		$('.search-submit').hide();
  	            $('.icon-msg').show();
    	        $('input[name=select]').attr('placeholder', '搜索食谱');
		    }); 
			    
  		    /*
  		    $('.sign-js').click(function(e){
    		    var _this = $(this);
    		    var sign = _this.attr('data-sign');
    		    if(sign == 0)
    		    {
        		    $.ajax({
        		        url: '/weixin/index/sign',
        		        type: 'GET',
        		        dataType: 'json',
        		        success: function(res){
        		            showToast(res.info);
        		            if(res.status == 1)
        		            {
        		            	_this.attr('data-sign', 1);
        		            }
        		        },
        		        error: function(res){
        		            showToast('系统繁忙');
        		        }
        		    });
    		    }
    		    else
    		    {
        		    showToast('你今天已经签到了');
    		    }
  		    });
  		    */

    		  $('.search-submit').click(function(e){
      		    e.preventDefault();
        		e.stopPropagation();
      		    var title = $('input[name=select]').val();
      		    if(title == undefined || title == null || title == '')
      		    {
      	  		    showToast('请输入搜索的关键字');
      	  		    return false;
      		    }
      		    location.href = "{:U('Work/search')}?title=" + title;
      		});

      		$('.search-js').click(function(e){
      		    e.preventDefault();
      		    e.stopPropagation();
      		    var title = $(this).text();
        		location.href = "{:U('Work/search')}?title=" + title;
      		});
  		});
    </script>
</body>
</html>
